/**
 * 
 */
package com.skood.platform.utils;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.json.JSONException;
import org.apache.struts2.json.JSONUtil;

/**
 * @author keege
 * @date 2013-12-13
 */
public class WebUtils {
	//private static Logger LOG = LoggerFactory.getLogger(WebUtils.class);
	public static void writeJson(HttpServletResponse response,Object result) throws JSONException, IOException{
		response.setCharacterEncoding("UTF-8");
		String jsonObj = JSONUtil.serialize(result);
		response.getWriter().write(jsonObj);
	}
}
